// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Serverless.Fluent;
using Elastic.Clients.Elasticsearch.Serverless.Requests;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport;
using Elastic.Transport.Extensions;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Serverless.Security;

public sealed partial class DisableUserProfileRequestParameters : RequestParameters
{
	/// <summary>
	/// <para>
	/// If 'true', Elasticsearch refreshes the affected shards to make this operation
	/// visible to search, if 'wait_for' then wait for a refresh to make this operation
	/// visible to search, if 'false' do nothing with refreshes.
	/// </para>
	/// </summary>
	public Elastic.Clients.Elasticsearch.Serverless.Refresh? Refresh { get => Q<Elastic.Clients.Elasticsearch.Serverless.Refresh?>("refresh"); set => Q("refresh", value); }
}

/// <summary>
/// <para>
/// Disables a user profile so it's not visible in user profile searches.
/// </para>
/// </summary>
public sealed partial class DisableUserProfileRequest : PlainRequest<DisableUserProfileRequestParameters>
{
	public DisableUserProfileRequest(string uid) : base(r => r.Required("uid", uid))
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.SecurityDisableUserProfile;

	protected override HttpMethod StaticHttpMethod => HttpMethod.PUT;

	internal override bool SupportsBody => false;

	internal override string OperationName => "security.disable_user_profile";

	/// <summary>
	/// <para>
	/// If 'true', Elasticsearch refreshes the affected shards to make this operation
	/// visible to search, if 'wait_for' then wait for a refresh to make this operation
	/// visible to search, if 'false' do nothing with refreshes.
	/// </para>
	/// </summary>
	[JsonIgnore]
	public Elastic.Clients.Elasticsearch.Serverless.Refresh? Refresh { get => Q<Elastic.Clients.Elasticsearch.Serverless.Refresh?>("refresh"); set => Q("refresh", value); }
}

/// <summary>
/// <para>
/// Disables a user profile so it's not visible in user profile searches.
/// </para>
/// </summary>
public sealed partial class DisableUserProfileRequestDescriptor : RequestDescriptor<DisableUserProfileRequestDescriptor, DisableUserProfileRequestParameters>
{
	internal DisableUserProfileRequestDescriptor(Action<DisableUserProfileRequestDescriptor> configure) => configure.Invoke(this);

	public DisableUserProfileRequestDescriptor(string uid) : base(r => r.Required("uid", uid))
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.SecurityDisableUserProfile;

	protected override HttpMethod StaticHttpMethod => HttpMethod.PUT;

	internal override bool SupportsBody => false;

	internal override string OperationName => "security.disable_user_profile";

	public DisableUserProfileRequestDescriptor Refresh(Elastic.Clients.Elasticsearch.Serverless.Refresh? refresh) => Qs("refresh", refresh);

	public DisableUserProfileRequestDescriptor Uid(string uid)
	{
		RouteValues.Required("uid", uid);
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
	}
}